<?php

namespace App\Http\Models;

//use Illuminate\Database\Eloquent\Model;
//使用guard验证登录用户时 可以继承Authenticatable; 这个类继承了Model类
use Illuminate\Foundation\Auth\User as Authenticatable;
//使用软删除 trait
use Illuminate\Database\Eloquent\SoftDeletes;
class Manager extends Authenticatable
{
    protected $table = 'manager';
    protected $primaryKey = 'mg_id';
    protected $fillable = ['mg_name','password','role_id','mg_sex','mg_remark'];
    use SoftDeletes;//使用软删除trait
    protected $dates = ['deleted_at'];

    //给Manager表管理role表
    public function role(){
        return $this->belongsTo('App\Http\Models\Role','role_id','role_id');
    }
}
